<?php
// +----------------------------------------------------------------------
//            -------------------------
//           /   / ----------------\  \
//          /   /             \  \
//         /   /              /  /
//        /   /    /-------------- /  /
//       /   /    /-------------------\  \
//      /   /                   \  \
//     /   /                     \  \
//    /   /                      /  /
//   /   /      /----------------------- /  /
//  /-----/      /---------------------------/
// +----------------------------------------------------------------------
// | Copyright (c) 2016 http://baimifan.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: Sage 2016/4/19  14:05
// +----------------------------------------------------------------------

namespace Common\Model;
use Think\Model\RelationModel;

class VideoModel extends RelationModel
{
    protected $_link = [
        'video_log' => [
            'mapping_type' => self::HAS_MANY,
            'class_name'   => 'video_log',
            'foreign_key'  => 'video_id',
        ],
        'video_apprise' => [
            'mapping_type' => self::HAS_MANY,
            'class_name'   => 'view_video_apprise',
            'foreign_key'  => 'video_id',
            'mapping_order'=>'create_time desc',
        ],
    ];
}